/*
 * @Author: tkp
 * @Date: 2025-01-03 16:24:13
 */
import { authInterfaceAdd, authInterfaceQuery, authInterfaceModify, authInterfaceDel, authSystemQuery, authRefreshCache } from '@/utils/api'
export class IndexBloc {
    queryForm = {
        interfaceName: '',
        url: '',
        systemId: '',
    }
    sysTeamType = []
    pageNum = 1
    pageSize = 50
    total = 0
    addPop = false
    rowItem = ''
    editPop = false
    tableOption = [
        { label: '所属系统', prop: 'systemId', slot: 'systemId' },
        { label: '接口名称', prop: 'interfaceName', },
        { label: '接口URL地址', prop: 'url', },
        { label: '是否白名单', prop: 'whitelistFlag', slot: 'whitelistFlag', width: '100' },
    ]
    tableData = []
    load(data) {
        authInterfaceQuery(data).then(res => {
            this.tableData = res.data.lst
            this.total = res.data.total
        })
    }
    modify(data) {
        return authInterfaceModify(data)
    }
    add(data) {
        return authInterfaceAdd(data)
    }
    del(data) {
        return authInterfaceDel(data)
    }
    loadSystem() {
        let param = {
            enable: 1
        }
        authSystemQuery(param).then(res => {
            this.sysTeamType = res.data || []
        })
    }
    refreshCache(data) {
        return authRefreshCache(data)
    }
}